/**
@C++ Standard: 11
@Copyright:Copyright (c) 2019 Harold Hu. All rights reserved.
@Author: Created by Harold Hu with CLion on 2019/1/12 13:57.
@File Name: DOCTEST_MAIN.cpp
@Description: For docTest Framework.
*/
#include "HaroldDebug.h"

#if TEST_TYPE == TEST_DOC
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest/doctest.h>

int fact(int num)
{
	return num <= 1 ? num : fact(num - 1) * num;
}

TEST_CASE ("testint factorial function")
{
			CHECK(fact(0) == 0);
			CHECK(fact(1) == 1);
			CHECK(fact(2) == 2);
			CHECK(fact(3) == 6);
			CHECK(fact(10) == 3628800);
}

#endif